Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: fix read of uninitialized variable. #421

Closed
wants to merge 1 commit into from

Conversation

chestnykh
Copy link

tf_flag wasn't initialized and it is read at line 2016 before any initialization.

@chestnykh chestnykh changed the title Fix read of uninitialized variable. BUG: Fix read of uninitialized variable. Nov 15, 2023
`tf_flag` wasn't initialized and it is read at line 2016
before any initialization.

Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
@pcmoore pcmoore changed the title BUG: Fix read of uninitialized variable. BUG: fix read of uninitialized variable. Nov 30, 2023
@pcmoore
Copy link
Member

pcmoore commented Nov 30, 2023

Is this based on manual code inspection or did you encounter a problem where tf_flag was actually read before it was initialized?

I ask this because immediately before line 2016 we have a NULL check on the c_prev variable which is always false the first time through the loop. On subsequent loop iterations tf_flag is guaranteed to be initialized due to the switch statement starting on line 2025.

However, if you've run into a problem where tf_flag is actually being read before it is initialized please let use know and we can work to fix it.

@drakenclimber drakenclimber added this to the v2.5.6 milestone Dec 4, 2023
@chestnykh
Copy link
Author

Is this based on manual code inspection or did you encounter a problem where tf_flag was actually read before it was initialized?

I ask this because immediately before line 2016 we have a NULL check on the c_prev variable which is always false the first time through the loop. On subsequent loop iterations tf_flag is guaranteed to be initialized due to the switch statement starting on line 2025.

However, if you've run into a problem where tf_flag is actually being read before it is initialized please let use know and we can work to fix it.

Yes, it's based on manual code inspection :)

@pcmoore
Copy link
Member

pcmoore commented Dec 4, 2023

Yes, it's based on manual code inspection :)

Thanks for the clarification. I appreciate the time you spent looking at the code, but I don't believe this is an actual bug as described above, and thus I don't believe this PR is needed.

I'll leave this PR open for a bit in case anyone wants to comment on this further, but as of right now I believe we can close this PR without merging.

@chestnykh
Copy link
Author

Yes, it's based on manual code inspection :)

Thanks for the clarification. I appreciate the time you spent looking at the code, but I don't believe this is an actual bug as described above, and thus I don't believe this PR is needed.

I'll leave this PR open for a bit in case anyone wants to comment on this further, but as of right now I believe we can close this PR without merging.

No problem

@pcmoore pcmoore closed this Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants